/*
    created: 2023/4/12
    filename: Main.c
    author: 李东霖
    purpose: 循环顺序队列操作的测试 
    备注：这里牺牲一个存储单元来区分队满和队空
*/

#include"seqqueue.h"

int main()
{
    PSqQueue q = NULL;
    InitQueue2(&q);
    if(NULL == q)
    {
        printf("初始化失败\n");
        return -1;
    } 
    for(int i = 0;i != 5;++i)
    {
        enQueue(q,&i);
    }
    
    DispQueue(q);
    printf("\n length = %d \n",LengthQueue(q));
    ElemType elem = 100;
    enQueue(q,&elem);
    DispQueue(q);
    printf("\n");
    deQueue(q,&elem);
    deQueue(q,&elem);
    DispQueue(q);
    printf("\n elem = %d\n",elem);
    GetHeadQueue(q,&elem);
    printf(" elem = %d\n",elem);
    ClearQueue(q);
    printf("length = %d \n",LengthQueue(q));
    DispQueue(q);

    return 0;
}